import { VueComponent } from "@/core/types";
import { componentName } from "../index";

interface IListType {
  label: string;
  value: string;
}
type sizeType = "large" | "small" | "default";

interface IData {
  list: IListType[];
  modelVal: string;
  change(val: string): void;
}

interface IProps {
  /**尺寸 */
  size?: sizeType;
  /**是否禁用 */
  disabled?: boolean;
  /**是否清空 */
  clearable?: boolean;
  /**占位文字 */
  placeholder?: string;
}

const defaultProps: IProps = {
  size: "default",
  disabled: false,
  clearable: true,
  placeholder: "请选择",
};

export class selectComp extends VueComponent<IData, IProps, selectComp> {
  getComponentName(): string {
    return componentName.SelectComp;
  }
  constructor(data: IData, props: IProps) {
    super(data, { ...defaultProps, ...props });
  }
}
